#include <iostream>
#include <vector>
#include <string>
#include <math.h>

using namespace std;

bool checkPerfectNumber(int num) {
    if(num == 1) return false;
    int c = 1;
    for(int i = 2; i <= sqrt(num); i++){
        if(num % i == 0){
            c += i + num / i;
        }
    }
    return c == num ? true : false;
}

int main(){
    int num = 28;
    cout << checkPerfectNumber(num) << endl;
    return 0;
}
